﻿function getScrollTop() {
    try {
        var scrollTop = 0;
        if (document.documentElement && document.documentElement.scrollTop) {
            scrollTop = document.documentElement.scrollTop;
        }
        else if (document.body) {
            scrollTop = document.body.scrollTop;
        }
        return scrollTop;
    }
    catch (e) { }
}

function getScrollLeft() {
    try {
        var scrollLeft = 0;
        if (document.documentElement && document.documentElement.scrollLeft) {
            scrollLeft = document.documentElement.scrollLeft;
        }
        else if (document.body) {
            scrollLeft = document.body.scrollLeft;
        }
        return scrollLeft;
    }
    catch (e) { }
}